package com.lhy;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class Test66 {
    public static void main(String[] args) {
        Test65 t = new Test65();
        t.name = "小明";
        t.address = "北京";
        t.SSN = 111222333;
        t.number = 101;
        try {
            FileOutputStream stream = new FileOutputStream("/com/lhy/Test65.ser");
            ObjectOutputStream obj = new ObjectOutputStream(stream);
            obj.writeObject(t);
            obj.close();
            stream.close();
            System.out.printf("Serialized data is saved in /com/lhy/Test65.ser");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
